SSD storage device can include a plurality of storage elements in which erasable segments are larger than the writable segments. For example, this may be the case in a NAND Flash where data can be erased in blocks and can be written in pages, and any block consists of several pages. This type of storage configuration may experience performance degradation resulting from blocks with only partly valid data.
General Description
Many of the functional components of the presently disclosed subject matter can be implemented in various forms, for example, as hardware circuits comprising custom VLSI circuits or gate arrays, or the like, as programmable hardware devices such as FPGAs or the like, or as a software program code stored on an intangible computer readable medium and executable by various processors, and any combination thereof. A specific component of the presently disclosed subject matter can be formed by one particular segment of software code, or by a plurality of segments, which can be joined together and collectively act or behave according to the presently disclosed limitations attributed to the respective component. For example, the component can be distributed over several code segments such as objects, procedures, and functions, and can originate from several programs or program files which operate in conjunction to provide the presently disclosed component.
In a similar manner, a presently disclosed component(s) can be embodied in operational data or operational data can be used by a presently disclosed component(s). By way of example, such operational data can be stored on tangible computer readable medium. The operational data can be a single data set, or it can be an aggregation of data stored at different locations, on different network nodes or on different storage devices.
According to an aspect of the presently disclosed subject matter there is provided a method of managing a SSD, comprising: partitioning a logical block address space in alignment with the SSD's blocks, giving rise to a plurality of SSD-block aligned groups, each group comprising a specific sequence of logical block addresses; determining whether a logical block address referenced in an incoming write request is a first logical block in a respective SSD-block aligned group, and if so:                opening an ongoing SSD-block aligned write session;        assigning a SSD block to the session; and        recording in the session's data an indication of which logical block address is associated with the write data that was saved to the SSD.        
According to an example of the presently disclosed subject matter there is further provided a method, further in response to determining that the logical block address is the first logical block in the group, storing respective write data in a first segment of the SSD block that was assigned to the respective ongoing SSD-block aligned write session.
According to an example of the presently disclosed subject matter there is yet further provided a method, wherein the ongoing SSD-block aligned write session further includes an offset parameter which indicates how many logical block addresses from the respective block aligned group were written so-far to the SSD block that was assigned to the session.
According to an example of the presently disclosed subject matter there is yet further provided a method, wherein in case the logical block address referenced in the incoming write request is not the first logical block in the respective SSD-block aligned group, determining whether the logical block address is a successor of a latest-saved logical block address of the group, and if so, storing the write data in a SSD block that was assigned to the respective group, in sequence with a latest used segment of the SSD-block.
According to an example of the presently disclosed subject matter there is yet further provided a method, wherein in case the logical block address referenced in the incoming write request is not the first logical block in the respective SSD-block aligned group, determining whether the logical block address is a successor of a latest saved logical block address of the group, and if so, storing the write data in a SSD block that was assigned to the respective group, in sequence with a last used segment of the SSD-block, and incrementing the offset parameter.
According to an example of the presently disclosed subject matter there is yet further provided a method, wherein when write data that is associated with an entire SSD-block aligned group is stored in the SSD-block, terminating the respective ongoing SSD-block aligned write session.
According to an example of the presently disclosed subject matter there is yet further provided a method, wherein the ongoing SSD-block aligned write session further includes a free flag, and wherein when the session is opened the free flag is set to false, and when the session is terminated resetting the free flag to true.
According to an example of the presently disclosed subject matter there is yet further provided a method, wherein when following terminating an ongoing SSD-block aligned write session that was associated with a certain SSD-block aligned group, a write request logical block address that is the first logical block in the same SSD-block aligned group is received at the SSD, performing:                opening a new ongoing write session;        assigning a new SSD block to the new session; and        recording the logical block address and the newly assigned SSD block in the new session's data.        
According to an example of the presently disclosed subject matter there is yet further provided a method, wherein in case it is determined that the logical block address referenced in the incoming write request is not the first logical block in the respective SSD-block aligned group, and is not the successor of the current last-saved logical block address of the group:                storing respective write data in a protected write buffer;        acknowledging the write request; and        determining, after a timeout period, whether the logical block address referenced in the write request that is associated with the write data that was stored in the protected write buffer is now the successor of the current latest-saved logical block address of the group.        
According to an example of the presently disclosed subject matter there is yet further provided a method, wherein in case it is determined that the logical block address referenced in the incoming write request is not the first logical block in the respective SSD-block aligned group, and is not the successor of the current last-saved logical block address of the group, storing respective write data in a SSD block that is reserved for out-of-sequence writes.
According to an example of the presently disclosed subject matter there is yet further provided a method, wherein in case it is determined that logical block address referenced in the incoming write request is mapped to one or more bad pages in the SSD-block assigned to the write session, storing respective write data in a SSD block that is reserved for out-of-sequence writes.
According to an aspect of the presently disclosed subject matter there is yet further provided an SSD, comprising:                a mapping module capable of mapping each one of a plurality SSD-block aligned groups to a respective SSD block from a respective plurality of SSD blocks, wherein a SSD-block aligned group comprises a specific sequence of logical block addresses;        a controller capable of determining whether a logical block address referenced in an incoming write request is a first logical block in a respective SSD-block aligned group, and if so, the controller is capable of:                    opening an ongoing write session;            assigning a SSD block to the session; and            recording in the session's data an indication of which logical block address is associated with the write data that was saved to the SSD.                        
According to an example of the presently disclosed subject matter there is yet further provided an SSD, wherein further in response to determining that the logical block address is the first logical block in the group, the controller is configured to store respective write data in a first segment of the SSD block that was assigned to the respective ongoing SSD-block aligned write session.
According to an example of the presently disclosed subject matter there is yet further provided an SSD, wherein the controller is further capable of recording in the session's data an offset parameter which indicates how many logical block addresses from the respective block aligned group were written so-far to the SSD block that was assigned to the session.
According to an example of the presently disclosed subject matter there is yet further provided an SSD, wherein in case the logical block address referenced in the incoming write request is not the first logical block in the respective SSD-block aligned group, the controller is capable of determining whether the logical block address is a successor of a latest-saved logical block address of the group, and if so, the controller is capable of storing the write data in a SSD block that was assigned to the respective group, in sequence with a latest used segment of the SSD-block.
According to an example of the presently disclosed subject matter there is yet further provided an SSD, wherein in case the logical block address referenced in the incoming write request is not the first logical block in the respective SSD-block aligned group, the controller is capable of determining whether the logical block address is a successor of a latest saved logical block address of the group, and if so, the controller is capable of storing the write data in a SSD block that was assigned to the respective group, in sequence with a last used segment of the SSD-block, and the controller is further capable of incrementing the offset parameter.
According to an example of the presently disclosed subject matter there is yet further provided an SSD, wherein when write data that is associated with an entire SSD-block aligned group is stored in the SSD-block, the controller is capable of terminating the respective ongoing SSD-block aligned write session.
According to an example of the presently disclosed subject matter there is yet further provided an SSD, wherein the controller is capable of including in the ongoing SSD-block aligned write session's data a free flag, and wherein when the session is opened the controller is configured to set the free flag to a false state, and when the session is terminated the controller is configured to reset the state of the free flag to true.
According to an example of the presently disclosed subject matter there is yet further provided an SSD, wherein when following terminating an ongoing SSD-block aligned write session that was associated with a certain SSD-block aligned group, a write request referencing a logical block address that is the first logical block in the same SSD-block aligned group is received at the SSD, the controller is capable of:                opening a new ongoing write session;        assigning a new SSD block to the new session; and        recording the logical block address and the newly assigned SSD block in the new session's data.        
According to an example of the presently disclosed subject matter there is yet further provided an SSD, wherein in case it is determined that the logical block address referenced in the incoming write request is not the first logical block in the respective SSD-block aligned group, and is not the successor of the current last-saved logical block address of the group, the controller is capable of:                storing respective write data in a protected write buffer;        acknowledging the write request; and        determining, after a timeout period, whether the logical block address referenced in the write request that is associated with the write data that was stored in the protected write buffer is now the successor of the current latest-saved logical block address of the group.        
According to an example of the presently disclosed subject matter there is yet further provided an SSD, wherein in case the controller determines that the logical block address referenced in the incoming write request is not the first logical block in the respective SSD-block aligned group, and is not the successor of the current last-saved logical block address of the group, the controller is capable of storing respective write data in an SSD block that is reserved for out-of-sequence writes.
According to an example of the presently disclosed subject matter there is yet further provided an SSD, wherein in case the controller determines that logical block address referenced in the incoming write request is mapped to one or more bad pages in the SSD-block assigned to the write session, the control is capable of storing respective write data in a SSD block that is reserved for out-of-sequence writes.
According to an aspect of the presently disclosed subject matter there is yet further provided a program storage device readable by machine, tangibly embodying a program of instructions executable by the machine to perform a method of managing a SSD, comprising:                partitioning a logical block address space in alignment with the SSD's blocks, giving rise to a plurality of SSD-block aligned groups, each group comprises a specific sequence of logical block addresses;        determining whether a logical block address referenced in an incoming write request is a first logical block in a respective SSD-block aligned group, and if so:                    opening an ongoing SSD-block aligned write session;            assigning a SSD block to the session; and            recording in the session's data an indication of which logical block address is associated with the write data that was saved to the SSD.                        
According to an aspect of the presently disclosed subject matter there is yet further provided a computer program product comprising a computer useable medium having computer readable program code embodied therein of managing a SSD, the computer program product comprising:                computer readable program code for causing the computer to partition a logical block address space in alignment with the SSD's blocks, giving rise to a plurality of SSD-block aligned groups, each group comprises a specific sequence of logical block addresses;        computer readable program code for causing the computer to determine whether a logical block address referenced in an incoming write request is a first logical block in a respective SSD-block aligned group, and if so:                    computer readable program code for causing the computer to open an ongoing SSD-block aligned write session;            computer readable program code for causing the computer to assign a SSD block to the session; and            computer readable program code for causing the computer to record in the session's data an indication of which logical block address is associated with the write data that was saved to the SSD.                        
It will be appreciated that for simplicity and clarity of illustration, elements shown in the figures have not necessarily been drawn to scale. For example, the dimensions of some of the elements may be exaggerated relative to other elements for clarity. Further, where considered appropriate, reference numerals may be repeated among the figures to indicate corresponding or analogous elements.